{include file="./public/static/block/admin/head.html"}
{include file="./public/static/block/admin/nav.html"}
<!--/. NAV TOP  -->
{include file="./public/static/block/admin/leftNav.html"}
<!-- /. NAV SIDE  -->
<div id="page-wrapper">
    <div id="page-inner">
        <div class="row">
            <div class="col-md-12">
                <h1 class="page-header">
                    服务信息添加 <small>用于服务信息新增</small>
                </h1>

            </div>
        </div>
        <div class="panel panel-default">
            <div class="panel-heading">
                增加服务信息
            </div>
            <div class="panel-body">
            <style type="text/css">
                ul,ol,li{
                    list-style: none;
                }
                tbody tr{
                    border-bottom:1px solid #ccc;

                }
                 tbody tr:hover{
                    background: #E6E6E6;
                 }
                 tbody tr.tr1:hover{
                    background:#fff;
                 }
                 tbody tr th{
                    text-align: center;
                 }
                tbody tr td{
                      padding:10px 0;
                }
                tbody tr td input[type=text]{
                    padding:3px 5px;
                    border:none;
                    outline: none;
                    border:1px solid #ccc;
                }
                tbody tr td input[type=date]{
                    padding:3px 17px 3px 5px;
                    border:none;
                    outline: none;
                    border:1px solid #ccc;
                    line-height: 1;
                }
                  tbody tr td select{
                    padding:3px 5px;
                    border:none;
                    outline: none;
                    border:1px solid #ccc;
                    margin-right:5px;
                }
                tbody tr td textarea{
                    border:none;
                    outline: none;
                    border:1px solid #ccc;
                    padding:5px;
                    resize: none;
                }
                .bt-big{
                    outline: none;
                    border:none;
                    color:#fff;
                    background: #32C2CD;
                    padding:8px 20px;
                    font-size: 16px;
                }
            </style>
            <form action="{:url('service/add')}" method="post" enctype="multipart/form-data">
                    <table width="100%" border="0" cellspacing="0" class="table-data form">
                        <tbody>

                            <tr><th>服务名:</th><td><input type="text" name="name" value="" class="input w-300"></td></tr>
                            <tr><th>分类:</th><td>
                            <select id="cate_id" name="cate_id">
                                {volist name='cates' id= 'cate'}
                                <option value="{$cate.cate_id}">{$cate.name}</option>
                                {/volist}
                            </select>
                            </td></tr>
                            <tr><th>价格:</th><td><input type="text" name="price" value="" class="input w-300"></td></tr>

                            <tr><th>封面图:</th><td><input type="file" name="cover" ></td></tr>
                            <tr><th>描述:</th><td>
                            <textarea  name="desc" style="width:700px;height:300px;"></textarea>
                            </td></tr>
                            <tr class="tr1"><th class="clear-th-bottom"></th><td class="clear-td-bottom" colspan="10"><input type="submit" class="bt-big" value="提交数据"></td></tr>
                        </tbody>
                    </table>
                </form>
                <script type="text/javascript">
                    
                    $('#cate_id').change(function(){
                        $(this).next('select').remove();
                        var _val=$(this).find('option:selected').val();
                            $.ajax({
                                url:'http://ucenter.znc365.com/admin.php/cate/get2cates',
                                type:'POST',
                                data:{
                                    cate_id:_val
                                },
                                success:function(data){
                                    if(data.code==200){
                                        if (data.data.length > 0) {
                                            var _select ='<select id="son_id" name="son_id"></select>';
                                            $('#cate_id').after(_select);
                                            for(var i=0;i<data.data.length;i++){
                                                var _option= "<option value='"+data.data[i].cate_id+"''>"+data.data[i].name+'</option>';
                                                $('#son_id').append(_option);
                                            }
                                        }
                                    }else{
                                        alert(data.message);
                                    }
                                    
                                },
                                error:function(error){
                                    console.log(error);
                                }
                            })
                        
                    });
                </script>
            </div>
        </div>
    </div>
</div>
<!-- /. PAGE WRAPPER  -->
{include file="./public/static/block/admin/foot.html"}